<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/XGameAdmin_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<?php
include('admin_lock.php');

if($_SERVER["REQUEST_METHOD"] == "POST")
{
	if(!empty($_POST['news']) || !empty($_POST['newsTitle']))
	{
		$news=addslashes($_POST['news']);
		$newsTitle=addslashes($_POST['newsTitle']);
		$writedate=date("Y-m-d");
		$hour= date("H") + 6;
		if($hour > 23)
		{$hour = $hour - 24;}
		$time=date("$hour:i:s");
		$sql="INSERT INTO news (news_title, news, news_date, news_time, user_ID) VALUES ('$newsTitle', '$news', '$writedate', '$time', '$login_session')";
		mysql_query($sql);
		header('Location: AdminMember.php');
	}
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>XGame</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
<link type="text/css" rel="stylesheet" href="CSS/adminCSS.css" />
</head>

<body>
<div id="container">

<div id="wrapper">

<div id="banner">
<ul class="topLink">
<li> Welcome, Admin </li>
<li> <a href="Logout.php"> Logout </a> </li>
</ul>

<img src="Assets/XGame.png" alt="XGame" />
</div>

<div id="menu">

<ul class="nav">
<li> <a href="AdminMember.php"> Member </a> </li>
<li> <a href="AdminNews.php"> News </a> </li>
<li> <a href="AdminGames.php"> Games </a> </li>
<li> <a href="AdminStock.php"> Stock </a> </li>
<li> <a href="AdminOrder.php"> Order </a> </li>
<li> <a href="AdminHistory.php"> History </a> </li>
</ul>
</ul>

</div>

<div id="main">
<!-- InstanceBeginEditable name="Main" -->
<div id="news">
<form method="POST">
<p> News Title: &nbsp; <input type="text" name="newsTitle" size="25" /> </p>

<textarea cols="80" rows="10" name="news"> </textarea>

<p> <input type="submit" name="submit" value="Submit" /> </p>
</form>
</div>
<!-- InstanceEndEditable -->
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 XGame </p>
</div>

</div>

</div>

</body>
<!-- InstanceEnd --></html>
